package com.jrx.anytxn.transaction.utils;

import com.jrx.anytxn.common.data.TxnRespCode;
import com.jrx.anytxn.common.exception.TxnBizException;
import com.jrx.anytxn.transaction.constant.TransBizConstant;

/**
 * 还款信息工具类
 *
 * @author zhenghaopu
 * date: 2019/9/24
 */
public class PaymentUtils {

    private PaymentUtils() {
    }

    /**
     * 获取还款类型名称
     *
     * @param paymentType 还款类型
     * @return 还款类型名称
     */
    public static String getPaymentTypeName(String paymentType) throws TxnBizException {
        String name;
        switch (paymentType) {
            case TransBizConstant.REPAYMENT_TYPE_PAY:
                name = TransBizConstant.REPAYMENT_TYPE_PAY_NAME;
                break;
            case TransBizConstant.REPAYMENT_TYPE_PREPAY:
                name = TransBizConstant.REPAYMENT_TYPE_PREPAY_NAME;
                break;
            case TransBizConstant.REPAYMENT_TYPE_PREPAY_CURR:
                name = TransBizConstant.REPAYMENT_TYPE_PREPAY_CURR_NAME;
                break;
            case TransBizConstant.REPAYMENT_TYPE_PRETERMINTION:
                name = TransBizConstant.REPAYMENT_TYPE_PRETERMINTION_NAME;
                break;
            case TransBizConstant.REPAYMENT_TYPE_OVERDUE:
                name = TransBizConstant.REPAYMENT_TYPE_OVERDUE_NAME;
                break;
            case TransBizConstant.REPAYMENT_TYPE_AUTO:
                name = TransBizConstant.REPAYMENT_TYPE_AUTO_CUST_NAME;
                break;
            case TransBizConstant.REPAYMENT_TYPE_STAGING:
                name = TransBizConstant.REPAYMENT_TYPE_STAGING_NAME;
                break;
            case TransBizConstant.REPAYMENT_TYPE_BILLOVERDUEPAY:
                name = TransBizConstant.REPAYMENT_TYPE_BILLOVERDUEPAY_NAME;
                break;
            case TransBizConstant.REPAYMENT_TYPE_BILLPAY:
                name = TransBizConstant.REPAYMENT_TYPE_BILLPAY_NAME;
                break;
            case TransBizConstant.REPAYMENT_TYPE_BILLPREPAYCURR:
                name = TransBizConstant.REPAYMENT_TYPE_BILLPREPAYCURR_NAME;
                break;
            case TransBizConstant.REPAYMENT_TYPE_WAIVEAUTO:
                name = TransBizConstant.REPAYMENT_TYPE_WAIVEAUTO_NAME;
                break;
            case TransBizConstant.REPAYMENT_TYPE_CMPS:
                name = TransBizConstant.REPAYMENT_TYPE_CMPS_NAME;
                break;
            case TransBizConstant.REPAYMENT_TYPE_CRT:
                name = TransBizConstant.REPAYMENT_TYPE_CRT_NAME;
                break;
            case TransBizConstant.REPAYMENT_TYPE_CHARGEOFF:
                name = TransBizConstant.REPAYMENT_TYPE_CHARGEOFF_NAME;
                break;
            case TransBizConstant.REPAYMENT_TYPE_BILLPREPAY:
                name = TransBizConstant.REPAYMENT_TYPE_BILLPREPAY_NAME;
                break;
            case TransBizConstant.REPAYMENT_TYPE_REFUND:
                name = TransBizConstant.REPAYMENT_TYPE_REFUND_NAME;
                break;
            case TransBizConstant.REPAYMENT_TYPE_BILLOVERDUE_PREPAYCURR:
                name = TransBizConstant.REPAYMENT_TYPE_BILLOVERDUE_PREPAYCURR_NAME;
                break;
            default:
                throw new TxnBizException(TxnRespCode.NO_DATA.getCode(), TxnRespCode.NO_DATA.getUserTips());
        }
        return name;
    }
}
